import { getTodayTurnover, getTotalTurnover } from "@/api/roomanalysis";
import dayjs from "dayjs";
import { onMounted, ref } from "vue";

/** 需求人数、提问数量、解决数量、用户满意度 */
onMounted(() => {
  console.log(22222222222222);
  getTodayTurnover(dayjs().format("YYYY-MM-DD")).then(response => {
    chartData[0].value = response.data;
    console.log("进来了" + chartData[0].value);
  });
  getTotalTurnover().then(response => {
    chartData[1].value = response.data;
  });
});
const chartData = ref([
  {
    bgColor: "#effaff",
    color: "#41b6ff",
    duration: 2200,
    name: "总营业额",
    value: 10000,
    data: [2101, 5288, 4239, 4962, 6752, 5208, 7450] // 平滑折线图数据
  },
  {
    bgColor: "#fff5f4",
    color: "#e85f33",
    duration: 1600,
    name: "昨日营业额",
    value: 200,
    data: [2216, 1800, 3000, 1700, 4821, 1973, 4379]
  }
]);

export { chartData };
